import { MutationTree } from "vuex";
import { IPicState, IPic } from "./types";

//判断文件名字和后缀相同，大小相同即为一张图片

const mutations: MutationTree<IPicState> = {
  //向图片列表添加数据
  savePics(state, item: IPic[]) {
    state.picList = item;
  },

  //删除某一条数据
  removePic(state, index: number) {
    state.picList.splice(index, 1);
  },
};

export { mutations };
